/** 
  * @author Ji Ye Choi <cgycgy@naver.com>
  * @version 1.6
  * @since 2010-10-23
  */ 

import java.awt.*;

public class ColoredTriangle extends Triangle {
	private Color color;

	public ColoredTriangle(Color c, Point p1, Point p2, Point p3) {
		super(p1, p2, p3);

		if(c == null) {
			c = Color.red;
			color = c;
		}

	}

	//version3
	public boolean equals(Object obj) {
		if(obj == null) 
			return false;

		if(obj.getClass() != this.getClass())
			return false;

		if(!super.equals(obj))
			return false;

		ColoredTriangle otherColoredTriangle = (ColoredTriangle) obj;
		return this.color.equals(otherColoredTriangle.color);
	}
}
